package com.ncd.form.domain;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
 * 单布局位置对象 form_layout_cell
 *
 * @author tree_new_bee
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
@TableName(value = "form_layout_cell")
public class LayoutCell {

    @TableId(value = "cell_id",type = IdType.AUTO)
    private Long cellId;

    /** 布局主表id */
    private Long cellLayout;

    /** 单元格类型(1 行元素;2 列元素;3 表单元素) */
    private String cellType;

    /** 如果cell_type是行和列的时候存的是行和列的style (row,colum-3) */
    private String cellStyle;

    /** cell_type类型是字典的时候存的字典表id */
    private Long cellDict;

    /** 父节点id */
    private Long cellParent;

    /** 版本表id */
    private Long cellVersionId;

    @TableField(exist = false)
    private FormDict dict;

    /** 子元素*/
    @TableField(exist = false)
    private List<LayoutCell> childrens=new ArrayList<>();

    public LayoutCell(Long cellLayout, String cellType, String cellStyle, Long cellDict, Long cellParent, Long cellVersionId) {
        this.cellLayout = cellLayout;
        this.cellType = cellType;
        this.cellStyle = cellStyle;
        this.cellDict = cellDict;
        this.cellParent = cellParent;
        this.cellVersionId = cellVersionId;
    }
}
